﻿using DoNet.Core;
using DoNet.System.IRepositories;
using DoNet.System.Models;

namespace DoNet.System.Repositories
{
    /// <summary>
    /// 
    /// </summary>
    public class TaskJobsLogRepository : BaseRepository<TaskJobsLog>, ITaskJobsLogRepository
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="serviceProvider"></param>
        public TaskJobsLogRepository(IServiceProvider serviceProvider) : base(serviceProvider)
        { }

        #region 同步方法
        /// <summary>
        /// 清空日志
        /// </summary>
        /// <returns></returns>
        public bool ClearLog()
        {
            return Db.DbMaintenance.TruncateTable<TaskJobsLog>();
        }
        #region 修改
        #endregion 修改

        #region 查询
        /// <summary>
        /// 同步根据主键Id列表获取集合数据
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        public IEnumerable<TaskJobsLog> GetListByIds(IEnumerable<long> ids)
        {
            return GetListByWhere(x => ids.Contains(x.Id));
        }
        #endregion 查询

        #endregion 同步方法

        #region 异步方法

        #region 修改
        #endregion 修改

        #region 查询
        /// <summary>
        /// 异步根据主键Id列表获取集合数据
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        public async Task<IEnumerable<TaskJobsLog>> GetListByIdsAsync(IEnumerable<long> ids)
        {
            return await GetListByWhereAsync(x => ids.Contains(x.Id));
        }
        #endregion 查询

        #endregion 异步方法
    }
}
